package cn.ml.gaoJi.jiHe.collections;

import cn.ml.entity.Student;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class CollectionDemo2 {
    public static void main(String[] args) {

        List<Student> list = new ArrayList<>();
        Student s1 = new Student(2,"李小明","男",18,1.76, LocalDate.of(2001,3,23), new BigDecimal(1111));
        Student s2 = new Student(4,"张小丽","女",18,1.61,LocalDate.of(2001,6,3), new BigDecimal(1111));
        Student s3 = new Student(3,"王大朋","男",19,1.82, LocalDate.of(2000,3,11), new BigDecimal(1111));
        Student s4 = new Student(1,"陈小跑","女",17,1.67,LocalDate.of(2002,10,18), new BigDecimal(1111));

        list.add(s1);
        list.add(s2);
        list.add(s3);
        list.add(s4);
        System.out.println(list.size());

        //升序
        Collections.sort(list);
        for (Student o:list){
            System.out.println(o.getId()+"---"+o.getName()+o.getSex());
        }

        long l = System.nanoTime();
        System.out.println(l);


    }
}
